<?php
/**
 * 知识网盘模块路由配置
 * 已更新为笔记相关路由，移除文件夹相关功能
 */

use think\facade\Route;
use app\controller\disk\Index;

// 笔记相关路由
Route::group('api/disk', function () {
    // 获取笔记列表
    Route::get('/list', [Index::class, 'list'])->name('disk.index.list');
    // 获取笔记详情
    Route::get('/detail', [Index::class, 'detail'])->name('disk.index.detail');
    // 创建笔记
    Route::post('/create', [Index::class, 'create'])->name('disk.index.create');
    // 更新笔记
    Route::put('/update', [Index::class, 'update'])->name('disk.index.update');
    // 删除笔记
    Route::delete('/delete', [Index::class, 'delete'])->name('disk.index.delete');
    // 上传附件
    Route::post('/upload-attachment', [Index::class, 'uploadAttachment'])->name('disk.index.uploadAttachment');
    // 移除附件
    Route::delete('/remove-attachment', [Index::class, 'removeAttachment'])->name('disk.index.removeAttachment');
    // 分享笔记
    Route::post('/share', [Index::class, 'share'])->name('disk.index.share');
    // 取消分享
    Route::post('/unshare', [Index::class, 'unshare'])->name('disk.index.unshare');
    // 获取可分享用户列表
    Route::get('/shareable-users', [Index::class, 'shareableUsers'])->name('disk.index.shareableUsers');
    // 获取可分享部门列表
    Route::get('/shareable-departments', [Index::class, 'shareableDepartments'])->name('disk.index.shareableDepartments');
    // 搜索笔记
    Route::get('/search', [Index::class, 'search'])->name('disk.index.search');
    // 关联附件到笔记
    Route::post('/attach-files', [Index::class, 'attachFilesToNote'])->name('disk.index.attachFilesToNote');
    // 下载附件
    Route::get('/download-attachment', [Index::class, 'downloadAttachment'])->name('disk.index.downloadAttachment');
    // 预览附件
    Route::get('/preview-attachment', [Index::class, 'previewAttachment'])->name('disk.index.previewAttachment');
});

// 知识网盘模块路由更新完成标记
// ROUTE_UPDATED: disk.php - 已更新为笔记相关路由配置